#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'libb@anchent.com'

# import turtle
#
# turtle.pensize(4)
# turtle.pencolor('red')
#
# turtle.forward(100)
# turtle.right(90)
# turtle.forward(100)
# turtle.right(90)
# turtle.forward(100)
# turtle.right(90)
# turtle.forward(100)
#
# turtle.mainloop()
a = 321
b = 123
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a // b)
print(a % b)
print(a ** b)

sum = 0
for i in range(101):
    sum += i
print(sum)
print([i for i in range(1, 99, 2)])

# 用for循环实现1~100之间的偶数求和

sum_i = 0
for i in range(2, 101, 2):
    sum_i += i
print(sum_i)

sum_x = 0
for x in range(1, 101):
    if x % 2 == 0:
        sum_x += x
print(sum_x)

for i in range(1, 10):
    for j in range(1, i + 1):
        # print('%d*%d=%d' % (i, j, i * j), end='  ')
        print('%d*%d=%d' % (i, j, i * j), end='\t')
    print()

# x = int(input('x = '))
# y = int(input('y = '))
# # 如果x大于y就交换x和y的值
# if x > y:
#     # 通过下面的操作将y的值赋给x, 将x的值赋给y
#     x, y = y, x
# # 从两个数中较的数开始做递减的循环
# for factor in range(x, 0, -1):
#     if x % factor == 0 and y % factor == 0:
#         print('%d和%d的最大公约数是%d' % (x, y, factor))
#         print('%d和%d的最小公倍数是%d' % (x, y, x * y // factor))
#         break

# row = int(input('请输入行数: '))
# for i in range(row):
#     for _ in range(i + 1):
#         print('*', end='')
#     print()
#
# for i in range(row):
#     for j in range(row):
#         if j < row - i - 1:
#             print(' ', end='')
#         else:
#             print('*', end='')
#     print()
import random

answer = random.randint(1, 100)
print(answer)
counter = 0
while True:
    counter += 1
    number = int(input('请输入: '))
    if number < answer:
        print('大一点')
    elif number > answer:
        print('小一点')
    else:
        print('恭喜你猜对了!')
        break
print('你总共猜了%d次' % counter)
if counter > 7:
    print('你的智商余额明显不足')